// GearRecognitionProj.cpp: 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#include <opencv2/core.hpp>
#include <opencv2/opencv.hpp>
#include <opencv2/imgcodecs.hpp>
#include <opencv2/highgui.hpp>
#include <iostream>

#include "Gray2Bit.h"

using namespace cv;
using namespace std;

int main()
{
	Mat image;
	string path = "D:\\Projects\\vs\\cpp\\GearRecognition\\GearRecognitionProj\\";
	image = imread(path + "gear.jpg", IMREAD_UNCHANGED);

	Gray2Bit gb;
	Mat bitImage = gb.DoGray2Bit(image, 300, false);

	imwrite(path + "bitgear2.jpg", bitImage);

	namedWindow("Display window", WINDOW_AUTOSIZE);
	imshow("Display window", image);

	namedWindow("Display bit window", WINDOW_AUTOSIZE);
	imshow("Display bit window", bitImage);

	waitKey(0);
    return 0;
}

